﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace VisitorsCounter
{
    public partial class VisitorsCounter : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Application["Visits"] == null)
            {
                Application["Visits"] = 0;
            }
            Application.Lock();
            Application["Visits"] = (int)Application["Visits"] + 1;
            Application.UnLock();
            this.LabelVisitorsNumber.Text = Application["Visits"].ToString();
        }
    }
}